﻿using FreeSql;
using Microsoft.Extensions.Configuration;
using TK.FreeSqlExtension;

namespace TK.Common.FreeSql
{
    /// <summary>
    /// freesql 接入
    /// </summary>
    public static class FreeSqlExtention
    {
        /// <summary>
        /// freesql orm
        /// </summary>
        public static IServiceCollection AddTKFreeSql(this IServiceCollection services, IConfiguration configuration)
        {
            services.AddFreeSqlOrm(ormConfig =>
            {
                ormConfig.ConnectionList.Add(new DbConnectionConfig { DataType = DataType.Dameng, Connection = "", DbKey = "DM" });
            });

            return services;
        }
    }
}
